package charpter12.lynx;

public class Nine {
	private static class Exception1 extends Exception{

		/**
		 * 
		 */
		private static final long serialVersionUID = 5159400095429034857L;
		public Exception1() {
			super("Exception1");
		}
	}

	private static class Exception2 extends Exception{

		/**
		 * 
		 */
		private static final long serialVersionUID = 5159400095429034857L;
		public Exception2() {
			super("Exception2");
		}
	}
	
	private static class Exception3 extends Exception{

		/**
		 * 
		 */
		private static final long serialVersionUID = 5159400095429034857L;
		public Exception3() {
			super("Exception3");
		}
	}
	
	public static void main(String[] args){
		for(int i = 1; i < 4; i++){
			try {
				test(i);
			} catch (Exception e) {
				e.printStackTrace();
			}			
		}	
	}
	
	private static void test(int i) throws Exception1,Exception2,Exception3{
		switch (i) {
		case 1:
			throw new Exception1();
		case 2:
			throw new Exception2();
		case 3:
			throw new Exception3();
		default:
			break;
		}
	}
}
